package chapter5_基础构建模块.队列桌面索引建立任务;

import java.io.File;
import java.util.concurrent.BlockingQueue;

public class Indexer implements Runnable {

    private final BlockingQueue<File> queue;

    public Indexer(BlockingQueue<File> queue) {
        this.queue = queue;
    }

    @Override
    public void run() {
        try {
            while (true) {
                //消费消息
                File file = queue.take();
//                indexFile(file);
            }
        } catch (Exception e) {
            Thread.currentThread().interrupt();
        }
    }
}
